//
//  UIButton+Extension.swift
//  微博
//
//  Created by mac on 15/12/17.
//  Copyright © 2015年 itcats. All rights reserved.
//

import UIKit

extension UIButton {

    convenience init(title: String,backImageName: String,fontSize: CGFloat,color: UIColor){
    self.init()
        setBackgroundImage(UIImage(named: backImageName), forState: .Normal)
        setTitle(title, forState: .Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
       setTitleColor(color, forState: .Normal)
        sizeToFit()
    }
    convenience init(imageNmae: String,backImageName: String) {
    self.init()
     setImage(UIImage(named: imageNmae), forState: .Normal)
        setImage(UIImage(named: imageNmae + "_highlighted"), forState: .Highlighted)
        setBackgroundImage(UIImage(named: backImageName), forState: .Normal)
     setBackgroundImage(UIImage(named: backImageName + "_highlighted"), forState: .Highlighted)
    sizeToFit()
    }

}
